<?php
if(!empty($model->event->title))
$this->breadcrumbs=array(
    'Thông tin đặt vé sự kiện: ' . $model->event->title,
);
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'event-form',
    'enableClientValidation'=>false,
    'clientOptions'=>array(
        'validateOnSubmit'=>false,
    ),
    'htmlOptions'=>array(
        'class'=>'form-horizontal form-body',
    ),
)); ?>
<fieldset>
    <legend>Thông tin sự kiện</legend>
    <!-- Order info -->
    <div class="form-group">
        <label class="col-xs-2 text-right">Tên sự kiện:</label>
        <div class="col-xs-8">
            <strong><?php if(!empty($model->event->title)) echo $model->event->title; ?></strong>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 text-right">Loại sự kiện:</label>
        <div class="col-xs-8">
            <strong><?php echo $model->event->getTicket(); ?></strong>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 text-right">Vé sự kiện:</label>
        <div class="col-xs-10">
            <!-- Event Ticket -->
            <div class="event-tickets">
            <?php if (!empty($model->tickets)) : ?>
            <?php $total = 0; ?>
            <?php foreach ($model->tickets as $data): ?>
                <div class="form-group">
                    <div class="col-xs-3 ticket-title">
                        <input type="text" class="form-control input-sm" value="<?php echo $data->ticket->title; ?>" disabled />
                    </div>
                    <label class="control-label ticket-price-label col-xs-2">Giá vé</label>
                    <div class="col-xs-3 input-icon right ticket-price">
                        <input type="text" class="form-control input-sm text-right" value="<?php echo number_format($data->ticket->price, 0, ',', '.').' VNĐ'; ?>" disabled />
                    </div>
                    <label class="control-label col-xs-2 text-right">Số lượng</label>
                    <div class="col-xs-2">
                        <input type="text" class="form-control input-sm text-right" value="<?php echo $data->quantity; ?>" disabled />
                    </div>
                </div>
            <?php $total = $total + ($data->quantity * $data->price); ?>
            <?php endforeach; ?>
                <div class="form-group">
                    <label class="control-label ticket-price-label col-xs-9 col-xs-offset-6">Tổng giá tiền</label>
                    <div class="col-xs-3 input-icon right ticket-price">
                        <input type="text" class="form-control input-sm text-right" value="<?php echo number_format($total, 0, ',', '.').' VNĐ'; ?>" disabled />
                    </div>
                </div>
            <?php else: ?>
                <strong>Liên hệ</strong>
            <?php endif; ?>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-xs-2 text-right">Trạng thái:</label>
        <div class="col-xs-10">
            <strong class="text-success"><?php echo $model->getStatus(); ?></strong>
        </div>
    </div>
</fieldset>
<fieldset>
    <legend>Thông tin người mua</legend>
    <!-- Order Buyer -->
    <div class="form-group">
        <?php echo $form->labelEx($model->buyer, 'lname', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'lname', array('class'=>'form-control input-sm', 'placeholder'=>'Họ và tên đệm', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'fname', array('class'=>'form-control input-sm', 'placeholder'=>'Tên', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->buyer, 'email', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-10">
            <?php echo $form->textField($model->buyer, 'email', array('class'=>'form-control input-sm', 'placeholder'=>'Địa chỉ Email', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->buyer, 'phone', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'phone', array('class'=>'form-control input-sm', 'placeholder'=>'Số điện thoại', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'altphone', array('class'=>'form-control input-sm', 'placeholder'=>'Số điện thoại khác', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->buyer, 'address', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-10">
            <?php echo $form->textField($model->buyer, 'address', array('class'=>'form-control input-sm', 'placeholder'=>'Địa chỉ', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-5 col-xs-offset-2">
            <?php echo $form->textField($model->buyer, 'ward', array('class'=>'form-control input-sm', 'placeholder'=>'Phường/Xã', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'district', array('class'=>'form-control input-sm', 'placeholder'=>'Quận/Huyện', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-5 col-xs-offset-2">
            <?php echo $form->textField($model->buyer, 'city', array('class'=>'form-control input-sm', 'placeholder'=>'Tỉnh/Thành phố', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->buyer, 'country', array('class'=>'form-control input-sm', 'placeholder'=>'Quốc gia', 'disabled'=>'disabled')); ?>
        </div>
    </div>
</fieldset>
<fieldset>
    <legend>Thông tin người nhận</legend>
    <!-- Order Buyer -->
    <div class="form-group">
        <?php echo $form->labelEx($model->receiver, 'lname', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'lname', array('class'=>'form-control input-sm', 'placeholder'=>'Họ và tên đệm', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'fname', array('class'=>'form-control input-sm', 'placeholder'=>'Tên', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->receiver, 'email', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-10">
            <?php echo $form->textField($model->receiver, 'email', array('class'=>'form-control input-sm', 'placeholder'=>'Địa chỉ Email', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->receiver, 'phone', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'phone', array('class'=>'form-control input-sm', 'placeholder'=>'Số điện thoại', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'altphone', array('class'=>'form-control input-sm', 'placeholder'=>'Số điện thoại khác', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->receiver, 'address', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-10">
            <?php echo $form->textField($model->receiver, 'address', array('class'=>'form-control input-sm', 'placeholder'=>'Địa chỉ', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-5 col-xs-offset-2">
            <?php echo $form->textField($model->receiver, 'ward', array('class'=>'form-control input-sm', 'placeholder'=>'Phường/Xã', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'district', array('class'=>'form-control input-sm', 'placeholder'=>'Quận/Huyện', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <div class="col-xs-5 col-xs-offset-2">
            <?php echo $form->textField($model->receiver, 'city', array('class'=>'form-control input-sm', 'placeholder'=>'Tỉnh/Thành phố', 'disabled'=>'disabled')); ?>
        </div>
        <div class="col-xs-5">
            <?php echo $form->textField($model->receiver, 'country', array('class'=>'form-control input-sm', 'placeholder'=>'Quốc gia', 'disabled'=>'disabled')); ?>
        </div>
    </div>
    <div class="form-group">
        <?php echo $form->labelEx($model->receiver, 'note', array('class'=>'control-label col-xs-2')); ?>
        <div class="col-xs-10">
            <?php echo $form->textArea($model->receiver, 'note', array('class'=>'form-control input-sm', 'placeholder'=>'Ghi chú đặt vé', 'rows'=>5, 'disabled'=>'disabled')); ?>
        </div>
    </div>
</fieldset>
<?php $this->endWidget(); ?>